package com.yunxi.job.otd;

import com.yunxi.hubToBiz.service.OtdSendPlanDubboService;
import com.yunxi.job.BaseJob;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

@DisallowConcurrentExecution
public class OtdSendPlanJob implements BaseJob {

    private static Logger logger = LoggerFactory.getLogger(OtdSendPlanJob.class);

    @Autowired
    OtdSendPlanDubboService otdSendPlanDubboServiceImpl;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        //// 下发生产计划 SO/CIR/PSO
        try {
            logger.debug("生产计划下发JOB开始执行");
            otdSendPlanDubboServiceImpl.sendPlan();
            logger.debug("生产计划下发执行结束");
        } catch (Exception e) {
            logger.error("生产计划下发错误：ERROR" + e.getMessage());
//            throw new JobExecutionException(e.getMessage());
        }
    }
}